@import (once) "../../include/vars";
@import (once) "../../include/mixins";

.sidebar {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow: hidden;
    width: 290px;
    background-color: @white;
    padding: 0;
    z-index: @zindex-fixed + 1;

    &.on-left {
        right: auto!important;
        left: -290px;
        transition: @transition-left;
        &.open, &.static {
            transition: @transition-left;
            left: 0;
            &.sidebar-shadow {
                box-shadow: 2px 0 0 0 rgba(0,0,0,0.15);;
            }
        }
    }

    &.on-right {
        transition: @transition-right;
        left: auto!important;
        right: -290px;
        &.open, &.static {
            transition: @transition-right;
            right: 0;
            &.sidebar-shadow {
                box-shadow: -2px 0 0 0 rgba(0,0,0,0.15);
            }
        }
    }
}

.sidebar-header, .sidebar-menu, .sidebar-content {
    display: block;
    position: relative;
    width: 100%;
}

.sidebar-header {
    background: @white top left no-repeat;
    background-size: cover;
    height: 160px;
    border-bottom: 1px #e0e0e0 solid;
}

.sidebar-header {

    & > .avatar {
        position: absolute;
        height: 64px;
        width: 64px;
        background: #ffffff;
        color: white;
        border-radius: 50%;
        top: 16px;
        left: 16px;
        overflow: hidden;
        text-align: center;
        border: 2px solid #fff;

        img {
            width: 100%;
            max-height: 100%;
        }
    }

    & > .title, & > .subtitle {
        display: block;
        position: absolute;
        left: 16px;
    }

    & > .title {
        font-size: 18px;
        font-weight: 100;
        top: 96px;
    }

    & > .subtitle {
        font-size: 12px;
        font-weight: 300;
        top: 116px;
    }

    & > .sub-action {
        position: absolute;
        top: 10px;
        right: 10px;
        text-decoration: none;
    }
}

.sidebar-menu {
    color: @dark;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none inside;
    overflow: hidden;
    overflow-y: auto;

    &.hide-scroll {
        width: ~"calc(100% + 18px)";
    }

    li {
        color: inherit;
        display: block;
        height: auto;
        position: relative;
        cursor: pointer;

        a {
            position: relative;
            display: block;
            color: inherit;
            text-transform: capitalize;
            height: 48px;
            line-height: 48px;
            padding-left: 56px;
            text-decoration: none;
            white-space: nowrap;
            text-overflow: ellipsis;

            &:hover {
                text-decoration: none;
            }
        }

        a {
            .icon {
                position: absolute;
                left: 16px;
                font-size: 24px;
                top: 50%;
                margin-top: -12px;
                line-height: 1;
                opacity: .8;
            }

            .label {

            }

            .ripple-ink {
                background: rgba(204, 204, 204, .3);
            }
        }

        .second-action {
            position: absolute;
            right: 16px;
            .square(24, px);
            font-size: 24px;
            top: 50%;
            margin-top: -12px;
        }

    }

    li {
        &.divider {
            padding: 0;
            height: 1px;
            margin: 0 1px;
            overflow: hidden;
            background-color: @borderColor;
            &:hover {
                background-color: @borderColor;
            }
        }
    }

    li + li {
    }

    .group-title {
        line-height: 1;
        height: auto;
        margin: 16px 16px 8px;
        color: @dark;
        font-weight: 700;
        font-size: .9em;
        cursor: default;
    }

    li {
        &.content-container {
            cursor: initial;
            padding: 0 10px;
        }
    }

    li {
        &:hover {
            background-color: @hoverBackground;
        }
    }

    li.group-title:hover {
        background-color: initial;
    }

    li.content-container:hover {
        background-color: initial;
    }

    .d-menu, .v-menu {
        position: relative;
        float: none;
    }
}

.sidebar-header ~ .sidebar-menu {
    height: ~"calc(100% - 160px)";
}

.sidebar.compact, .subcompact {
    .sidebar-menu {
        li {
            height: auto;
            a {
                padding-top: 7px;
                padding-bottom: 7px;
                line-height: 1.2;
                font-size: 14px;
                padding-left: 40px;
                .icon {
                    font-size: 14px;
                    margin-top: -7px;
                }
            }
        }
    }
}
.sidebar.subcompact {
    .sidebar-menu {
        li {
            a {
                padding-top: 3px;
                padding-bottom: 3px;
            }
        }
    }
}